package com.chen.awt;

import java.awt.Button;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *@author：email: <a href="cyb@ewppay.com"> Administrator </a> 
 *@Date 2017-2-10 下午1:44:16 
 */

public class Test extends Frame implements ActionListener{
	Button addBtn = new Button("add");
	Button exitBtn = new Button("exitBtn");
	
	public Test(){
		this.setTitle("第一个窗口test");
		this.setLocation(100, 100);
		this.setSize(200, 200);
		this.setVisible(true);
		
		
		this.setLayout(new FlowLayout());
		this.add(addBtn);
		this.add(exitBtn);
	}
	
	public static void main(String[] args){
		Test test = new Test();
		
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == addBtn){
			System.out.println("add");
		}else{
			System.out.println("exit");
		}
	}
}
